package com.gs.synedocket.db.domain;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.gs.synedocket.db.domain.HttpCache;
import com.gs.synedocket.db.domain.LogData;

import com.gs.synedocket.db.domain.HttpCacheDao;
import com.gs.synedocket.db.domain.LogDataDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig httpCacheDaoConfig;
    private final DaoConfig logDataDaoConfig;

    private final HttpCacheDao httpCacheDao;
    private final LogDataDao logDataDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        httpCacheDaoConfig = daoConfigMap.get(HttpCacheDao.class).clone();
        httpCacheDaoConfig.initIdentityScope(type);

        logDataDaoConfig = daoConfigMap.get(LogDataDao.class).clone();
        logDataDaoConfig.initIdentityScope(type);

        httpCacheDao = new HttpCacheDao(httpCacheDaoConfig, this);
        logDataDao = new LogDataDao(logDataDaoConfig, this);

        registerDao(HttpCache.class, httpCacheDao);
        registerDao(LogData.class, logDataDao);
    }
    
    public void clear() {
        httpCacheDaoConfig.clearIdentityScope();
        logDataDaoConfig.clearIdentityScope();
    }

    public HttpCacheDao getHttpCacheDao() {
        return httpCacheDao;
    }

    public LogDataDao getLogDataDao() {
        return logDataDao;
    }

}
